package org.wheel.module.core.request;

import lombok.Data;

@SuppressWarnings("rawtypes")
@Data
public class ParamSort implements Comparable {
    private String field; // 字段名
    private String sortType; // 正序：Asc， 倒序：Desc
    private int sno; // 排序顺序

    @Override
    public int compareTo(Object o) {
        if (o instanceof ParamSort) {
            if (this.sno == ((ParamSort) o).getSno()) {
                return this.field.compareTo(((ParamSort) o).getField());
            }
            return this.sno - ((ParamSort) o).getSno();
        }
        return -1;
    }
}
